import { axios } from '@/utils/request'

/**
 * api接口列表
 */
const api = {
  index: '/book/page/index',
  changeStatus: '/book/page/changeStatus',
  edit: '/book/page/edit',
  sync: '/book/page/syncFile',
  getSyncNum: '/book/page/getSyncNum',
  getOption: '/book/dirOptions',
  batchAdd: '/book/page/batchAdd',
  batchList: '/book/page/batchList',
  batchAddNullPage: '/book/page/batchAddNull',
  coverPage: '/book/page/cover',
  syncNodeFile: '/book/page/syncNodeFile',
  addQuestions:'/questions/add',
  questionsList:'/questions/index',
  questionsEdit:'/questions/edit',
  questionsDelete:'/questions/delete',
  questionsChangeStatus:'/questions/changeStatus',
}

/**
 * 列表记录
 */
export function list(params) {
  return axios({
    url: api.index,
    method: 'get',
    params
  })
}
export function changeStatus(params) {
  return axios({
    url: api.changeStatus,
    method: 'get',
    params
  })
}
export function edit(data) {
  return axios({
    url: api.edit,
    method: 'post',
    data
  })
}

export function syncFile(params) {
  return axios({
    url: api.sync,
    method: 'get',
    params
  })
}

export function getSyncNum(params) {
  return axios({
    url: api.getSyncNum,
    method: 'get',
    params
  })
}



//获取记录选项
export function getDirOptions(params) {
  return axios({
    url: api.getOption,
    method: 'get',
    params
  })
}

export function batchAdd(data) {
  return axios({
    url: api.batchAdd,
    method: 'post',
    data
  })
}

export function batchList(params) {
  return axios({
    url: api.batchList,
    method: 'get',
    params
  })
}

export function batchAddNullPage(data) {
  return axios({
    url: api.batchAddNullPage,
    method: 'post',
    data
  })
}

export function coverPage(params) {
  return axios({
    url: api.coverPage,
    method: 'get',
    params
  })
}

export function syncNodeFile(params) {
  return axios({
    url: api.syncNodeFile,
    method: 'get',
    params
  })
}

export function addQuestions(data) {
  return axios({
    url: api.addQuestions,
    method: 'post',
    data
  })
}

export function questionsList(params) {
  return axios({
    url: api.questionsList,
    method: 'get',
    params
  })
}

export function questionsEdit(data) {
  return axios({
    url: api.questionsEdit,
    method: 'post',
    data
  })
}

export function questionsDelete(params) {
  return axios({
    url: api.questionsDelete,
    method: 'get',
    params
  })
}

export function questionsChangeStatus(params) {
  return axios({
    url: api.questionsChangeStatus,
    method: 'get',
    params
  })
}